package com.hzutitech.aqfxgk.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class FileselectionActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.upload);
		Button btn = (Button) findViewById(R.id.btn_open);
		btn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String path = null;
				String[] fileType = { "jpg" };// 要过滤的文件类型列表
				FileselectionDialog dlg = new FileselectionDialog(FileselectionActivity.this, fileType, path, new FileselectionDialogListener() {
					@Override
					public void onOkClick(String name) {
						TextView txtFileName = (TextView) findViewById(R.id.txt_file_name);
						txtFileName.setText(name);
					}

					@Override
					public void onCancelClick() {

					}
				});
				dlg.setTitle("请选择要上传的文件");
				dlg.show();
			}
		});
	}

}